package com.hawthorn.admin.feign.jobService;

import com.hawthorn.platform.config.FeignConfig;
import com.hawthorn.platform.model.po.SysJobPO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.FeignFallback;
import org.springframework.cloud.openfeign.HystrixFallbackFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * <p>todo 调用定时任务feign</p>
 * @author: andy.ten@tom.com | xukaixing@hotmail.com
 * @created: 2022/9/12 14:41
 * @version v1.0.1
 * @copyright: Copyright (c)  andyten
 */
@FeignClient(name = "sentury-rms-job", contextId = "rmsJobApiClient", path = "/jobapi", configuration = FeignConfig.class, fallbackFactory = HystrixFallbackFactory.class)
public interface RmsJobFeignService extends FeignFallback
{
  @GetMapping(value = "/resumeJob")
  void resumeJob(@RequestBody SysJobPO sysJobPO);

  @GetMapping(value = "/pauseJob")
  void pauseJob(@RequestBody SysJobPO sysJobPO);

  @GetMapping(value = "/runJobNow")
  void runJobNow(@RequestBody SysJobPO sysJobPO);

  @PostMapping(value = "/addJob")
  void addJob(@RequestBody SysJobPO sysJobPO);

  @PostMapping(value = "/updateJobCron")
  void updateJobCron(@RequestBody SysJobPO sysJobPO);
}
